<%--
  Created by IntelliJ IDEA.
  User: 杨威
  Date: 2021/9/23
  Time: 20:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
用户名：<input type="text" id="username" /><br/>
密码：<input type="password" id="password"/><br/>
<button onclick="logins()">登录</button>

<script src="js/jquery-1.12.4.js"></script>
<script type="text/javascript">
    //$.post(url,data,callback,dataType); 没有contentType，只能发送普通表单数据
    function logins() {
        $.post("testPost","username="+$("#username").val()+"&password="+$("#password").val(),function (msg) {
            alert(msg)
        })
    }
</script>
</body>
</html>
